<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>

        // var a = 10
        // var b = 20
        // var [b, a] = [a, b]
        // console.log(a, b) // 20,10

        // let arr = [1, 2, 3]
        // let [a, b, c] = arr
        // console.log(a, b, c) // 1,2,3

        // const arr = [1, [2, 3, [4, 5, 6]]];
        // const [a, [b, c, [d, e, f]]] = arr;
        // console.log(a, b, c, d, e, f) // 1,2,3,4,5,6

        // let [a = true] = [];
        // console.log(a) 	// true


        let obj = {
            name: '张三',
            age: 18,
            obj1: {
                myname: '李四',
                hoppy: 'zhuqiu'
            }
        }
        let { name, age,obj1:{myname,hoppy} } = obj;
        console.log(myname, hoppy);
    </script>
</body>

</html>